using Google.Protobuf;
using System;
using static HotfixMain.DataDef_Helper;
using pb = Google.Protobuf;
namespace HotfixMain
{

    public class DataDef_Helper
    {
        public delegate string GetLanguageFunc(int id);

        public static GetLanguageFunc getLanguageFunc;
        public static void SetLanFunc(GetLanguageFunc get)
        {
            getLanguageFunc = get;
        }
    }

    /// <summary>
    /// 语言表Id
    /// </summary>
    public sealed partial class Language_ID : pb::IMessage
    {
        private string str;
        /// <summary> 获取语言表对应文本 </summary>

        public string Str
        {
            get
            {
                if (string.IsNullOrEmpty(str) && getLanguageFunc != null)
                {
                    str = getLanguageFunc(LanguageId);
                }
                return str;
            }
        }
    }
    

    public sealed partial class long_Array : pb::IMessage
    {
        public long this[int index]
        {
            get
            {
                return Items[index];
            }
        }
        public int Length
        {
            get { return Items.Count; }
        }
    }

    public sealed partial class int_Array : pb::IMessage
    {

        public int this[int index]
        {
            get
            {
                return Items[index];
            }
        }

        public int Length
        {
            get { return Items.Count; }
        }
    }

    public sealed partial class float_Array : pb::IMessage
    {
        public float this[int index]
        {
            get
            {
                return Items[index];
            }
        }

        public int Length
        {
            get { return Items.Count; }
        }
    }

    public sealed partial class bool_Array : pb::IMessage
    {
        public bool this[int index]
        {
            get
            {
                return Items[index];
            }
        }

        public int Length
        {
            get { return Items.Count; }
        }
    }

    public sealed partial class string_Array : pb::IMessage
    {
        public string this[int index]
        {
            get
            {
                return Items[index];
            }
        }

        public int Length
        {
            get { return Items.Count; }
        }
    }

    public sealed partial class Language_ID_Array : pb::IMessage
    {
        public Language_ID this[int index]
        {
            get
            {
                return Items[index];
            }
        }

        public int Length
        {
            get { return Items.Count; }
        }
    }
}
public class PbCfgImportDat
{
    public Type type;
    public Func<IMessage, long> getIdFunc;
    public Func<IMessage> factory;
}